package com.designpatterns.factory.factory1.pizzaStroe;

import com.designpatterns.factory.factory1.pizza.Pizza;
import com.designpatterns.factory.factory1.pizzaFactoy.SimplePizzaFactory;

public class PizzaStore {
    SimplePizzaFactory factory;
    public PizzaStore(SimplePizzaFactory factory) {
        this.factory = factory;
    }

    public Pizza orderPizza(String type){
        Pizza pizza;
        pizza = factory.createPizza(type);

        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
        return pizza;
    }
}
